home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / NAMES.DMO < prev    next >
Text File  |  1996-07-04  |  4KB  |  74 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   NAMES   .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. COLOR 7,0
  23. CLS
  24.  
  25. ? "┌─────────────────────────────────────────────────────────────────────────────
  26. ? "│ fDisplayName$    ( D$, Sep? )
  27. ? "│ fDisplayNameLF$  ( D$, Sep? )
  28. ? "│ fDisplayNameLFH$ ( D$, Sep? )
  29. ? "│  StripName       ( D$, Sep?, L$, F$, H$ )
  30. ? "├─────────────────────────────────────────────────────────────────────────────
  31. ? "│ Storage and manipulation of names is a very important part of any program
  32. ? "│ that is in the business of using this data. It is difficult for a programmer
  33. ? "│ to get it all right all the time but there is some small flicker of light at
  34. ? "│ the end of the tunnel! Throughout most of the western world there is a single
  35. ? "│ governing rule for printing names and honorifics: (Mr. PhD. etc) Preceding
  36. ? "│ honorifics are followed by a space and trailing honorifics are preceded by a
  37. ? "│ comma. Despite this, there are at least 3 formats that are required by the
  38. ? "│ users and, possibly, the program. Another problem is just how much space
  39. ? "│ should be reserved for the name? 17 chars is the average in the USofA but
  40. ? "│ if you force your user to input LASTNAME, FIRSTNAME you will quickly end-up
  41. ? "│ with a FIRSTNAME LASTNAME input that gets index all out of whack until it's
  42. ? "│ fixed. I offer my users 3 fields for a name: Last, First & Middle, and
  43. ? "│ honorifics. Each field is about 30 chars in length and I impose a maximum
  44. ? "│ length of the 3. This allows a variable length for each of the 3, protects
  45. ? "│ the data against bad input, and allows me to make several different styles
  46. ? "│ of the name for printing & displaying.
  47. ? "└──────────────────────────────────────────────────────────────────────────
  48. LOCATE 25, 65 : PRINT "THUMP A BUTTON";
  49. fAnyKey
  50. CLS
  51.  
  52. D$   = "Schullian|Donald A.|Mr., Jr.,Esq."
  53. Sep? = ASCII( "|" )
  54.  
  55.   PRINT "Our data is stored like this: "; CHR$(34); D$; CHR$(34)
  56.   PRINT
  57.  
  58. StripName D$, Sep?, L$, F$, H$
  59.   PRINT "       First Name: "; F$
  60.   PRINT "        Last Name: "; L$
  61.   PRINT "       Honorifics: "; H$
  62.   PRINT
  63.  
  64. N$ = fDisplayName$( D$, Sep? )
  65.   PRINT "The formal format: "; N$
  66.   PRINT
  67.  
  68. N$ = fDisplayNameLF$ ( D$, Sep? )
  69.   PRINT "      Index style: "; N$
  70.   PRINT
  71.  
  72. N$ = fDisplayNameLFH$( D$, Sep? )
  73.   PRINT "  Alternate Style: "; N$
  74.